package com.tm.servicemsm.controller;

import com.tm.servicemsm.service.CommunityService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2024/7/19 我的小区、房产管理、绑定业主、点赞评论、首页咨询 Cjj
 */
@RestController
@RequestMapping("/community")
public class CommunityController {
    private CommunityService communityService=new CommunityService();

    @PostMapping("/bindOwner")
    public String bindOwner(@RequestParam String houseId,@RequestParam String ownerName){
             communityService.bindOwner(houseId,ownerName);
             return "业主绑定成功";
    }

    @PostMapping("/praise")
    public String praiseHouse(@RequestParam String houseId){
        communityService.praiseHouse(houseId);
        return "点赞成功";
    }

    @PostMapping("/comment")
    public String commentHouse(@RequestParam String houseId,@RequestParam String comment){
        communityService.commentHouse(houseId, comment);
        return "留言评论成功";
    }
}
